home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / exec / funret.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  651 b   |  30 lines

  1. /*
  2. \funcref{fun\_ret}{void fun\_ret ()}
  3.     {}
  4.     {}
  5.     {pop(), discard()}
  6.     {fun\_call()}
  7.     {funret.c}
  8.     {
  9.  
  10.         This code terminates a called function. The assembler opcodes {\em mov
  11.         sp, bp ; pop bp} are simulated by popping and discarding until {\em sp}
  12.         equals {\em bp} and subsequently popping {\em bp}.
  13.  
  14.         After this, the return address is popped and the file pointer
  15.         associated with the input file is set to this address.
  16.  
  17.     }
  18. */
  19.  
  20. #include "icm-exec.h"
  21.  
  22. void fun_ret ()
  23. {
  24.     while (sp != bp)
  25.         discard (pop());
  26.     bp = pop().vu.intval;
  27.  
  28.     fseek (infile, (INT32) pop().vu.intval, SEEK_SET);
  29. }
  30.